<%@page contentType="text/html; charset=utf-8" pageEncoding="UTF-8" %>
<jsp:include page="/includes/header.jsp" />
<jsp:include page="/includes/column_left_admin.jsp" />
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!-- begin middle column -->

<section id="admin">

<h1>你的发票</h1>

<table>
  <tr>
    <td><b>出具时间</b></td>
    <td>${invoice.invoiceDate}</td>
    <td></td>
  </tr>
  <tr>
    <td><b>寄往</b></td>
    <td>${invoice.user.addressHTMLFormat}</td>
    <td></td>
  </tr>
  <tr><td colspan="3"><hr></td></tr>
  <tr>
    <td><b>数量</b></td>
    <td><b>商品详情</b></td>
    <td><b>价格</b></td>
  </tr>
  
  <c:forEach var="item" items="${invoice.lineItems}">
  <tr>
    <td>${item.quantity}</td>
    <td>${item.product.description}</td>
    <td>${item.totalCurrencyFormat}</td>
  </tr>
  </c:forEach>

  <tr><td colspan="3"><hr></td></tr>
  <tr>
    <td><b>总计：</b></td>
    <td></td>
    <td><p>${invoice.invoiceTotalCurrencyFormat}</td>
  </tr>      
</table>

<label>支付信息</label>
<span>${invoice.user.creditCardType}: ${invoice.user.creditCardNumber} 
    (${invoice.user.creditCardExpirationDate})</span><br>
<label>邮箱地址</label>
<span>${invoice.user.email}</span><br>

<form action="processInvoice" method="post">
  <input type="submit" value="出具发票">
</form>
<form action="displayInvoices" method="post">
  <input type="submit" value="查看未处理的发票">
</form>

</section>

<!-- end middle column -->

<jsp:include page="/includes/footer.jsp" />